#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
using namespace std;

const int N = 1e7 + 10;
int arr[N];
int n, x;

int main()
{
	cin >> n >> x;
	for (int i = 1; i <= n; i++) cin >> arr[i];

	int right = 0, left = 0, sum = 0;
	int retright = -1, retleft = -1, ret = N;

	while (right <= n)
	{
		sum += arr[right];
		while (sum >= x)
		{
			if (right - left + 1 < ret)
			{
				retright = right;
				retleft = left;
				ret = retright - retleft + 1;
			}
			sum -= arr[left++];
		}
		right++;
	}

	cout << retleft << " "<< retright << endl;
	return 0;
}